/****************************************************************************

Force Engine v0.5

Creado: 25/04/09
Clase: BSPNode.h
Hecho by: Pedro Mancheno

****************************************************************************/
//---------------------------------------------------------------------------
#ifndef BSPNODE_H
#define BSPNODE_H
//---------------------------------------------------------------------------
#include <vector>
#include "Node.h"
#include "../Geometry/Plane.h"
#include "../Utilities/Utilities.h"
//---------------------------------------------------------------------------
using namespace std;
//---------------------------------------------------------------------------
class FORCEENGINE_API BSPNode: public Node
{
public:

	BSPNode();
	BSPNode(Graphics &rkGraphics);
	~BSPNode();

	bool Initialize(std::string szName, INode * pkParentNode = NULL);

	bool AddChildNode(INode * pkChildNode);
	void RemoveChildNode(INode * pkChildNode);

	//const BVH * Update();
	void Draw();

	int WhichSideIsOn(D3DXVECTOR3 rkEyePos, Plane rkPlane);

	//Setters
	void SetPlane(Plane rkPlane);
	void SetLeftNode(INode * pkNode);
	void SetRightNode(INode * pkNode);

	//Getters
	Plane * GetPlane();
	INode * GetLeftNode();
	INode * GetRightNode();

private:
	Plane * m_pkHyperPlane;
	INode * m_pkLeftNode;
	INode * m_pkRightNode;
};

//---------------------------------------------------------------------------

#endif /*--- NODE_H ---*/

//---------------------------------------------------------------------------